Skip to content

Conversation

@Eji4h
Copy link

@Eji4h Eji4h commented Oct 16, 2020

Welcome to JavaScript community

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new JavaScript files are placed inside an existing directory.
  • All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.
    Example:UserProfile.js is allowed but userprofile.js,Userprofile.js,user-Profile.js,userProfile.js are not
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@Eji4h
Copy link
Author

Eji4h commented Oct 18, 2020

@pomkarnath98 Why to don't merge this PR?

@pomkarnath98
Copy link
Member

Factorial is already there in the list. So we can only merge if it is not present in the list. Hope you understand.
Thank you

@Eji4h
Copy link
Author

Eji4h commented Oct 19, 2020

Factorial is already there in the list. So we can only merge if it is not present in the list. Hope you understand.
Thank you

It's already but i'm refactor code to minimal side effects.

@pomkarnath98
Copy link
Member

Ok, we will get back to you soon.
But you should mention the #{ISSUE_NO} that your code resolved. And if it's not there you could create one and then mention by stating that the code ia fixing that issue.

@pomkarnath98 pomkarnath98 reopened this Oct 19, 2020
@Eji4h
Copy link
Author

Eji4h commented Oct 19, 2020

Fixed #503

@pomkarnath98 pomkarnath98 requested a review from cclauss October 25, 2020 13:55
Copy link
Contributor

@marsonya marsonya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Eji4h, the refactoring looks good. There one thing that needs changing.
Move the (num > 0) if condition to the end.

It's a general practice to validate the input first and then calculate and return the solution if the input passes validation.

@marsonya marsonya added the changes required This pull request needs changes label Jan 22, 2021
@cclauss cclauss removed their request for review January 22, 2021 04:23
@Eji4h Eji4h requested a review from marsonya January 22, 2021 05:54
@marsonya marsonya merged commit c8ab618 into TheAlgorithms:master Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes required This pull request needs changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants